#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
using namespace std;

vector<int> lengthOfLIS(vector<int>& nums)
{
	vector<int> tmp, res;
	int n = nums.size();
	if (n == 0) return {};
	for (int i = 0; i < n; i++)
	{
		tmp.push_back(nums[i]);
		for (int j = i+1; j < n; j++)
		{
			if (nums[j] > tmp.back()) {
				tmp.push_back(nums[j]);
			}
		}
		if (tmp.size() > res.size()) {
			res.swap(tmp);
		}
		tmp.clear();
	}
	return res;
}

//int main()
//{
//	vector<int> nums = {10,9,2,5,3,7,101,18};
//	vector<int> res;
//	res = lengthOfLIS(nums);
//	for (auto e : res) cout << e << " ";
//
//	return 0;
//}